<template>
  <div>
    <tr  >
          <td>合计:</td>
          <td >{{getSum}}</td>
        </tr>
  </div>
</template>

<script>

export default {
props:["arr"] ,
computed: {
  getSum(){
  return this.arr.reduce((sum,obj)=>obj.checked ? sum+(obj.price*obj.num): sum,0)
  }
}

}
</script>

<style>
td{
 border: 1px solid #ccc;
 width: 700px;
}
</style>